package com.example.demo.endpoint;

import com.example.demo.entity.PositionEntity;
import com.example.demo.service.PersonalService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Random;
import java.util.Set;

@Controller
@RequestMapping("/recruit/personal")
public class PersonalEndpoint {

    @Autowired
    PersonalService personalService;

    @ResponseBody
    @RequestMapping("/findSharePositionByUserId")
    public Set<PositionEntity> findSharePosition(String userId) {
        return personalService.findSharePositionByUserId(userId);
    }

    @ResponseBody
    @RequestMapping("/insertSharePosition")
    public void insertIntoShare(String positionId, String userId) {

        personalService.insertSharePosition(positionId, userId);
    }

}
